package servlet.miniprojet.infrastructure;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class Accueil extends HttpServlet {
	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse
			response) throws IOException, ServletException{
		
		HttpSession session = request.getSession(false);
		
		if((session != null) && (session.getAttribute("error") != null)){
			request.setAttribute("error", session.getAttribute("error"));
			session.invalidate();
		}
		
		request.getRequestDispatcher("SiteWebJsp/Accueil.jsp").forward(request, response);
	}

}